<?php
defined('IN_XLP') or exit('Access Denied');

$Document = array(
    'pageid'   => 'order-index', //页面标示
    'pagename' => '订单分析', //当前页面名称
    'mycss'    => array('../jquery-ui/css/smoothness/jquery-ui-1.10.0.custom.min'), //加载的css样式表
    'myjs'     => array(), //加载的js脚本
    'footerjs' => array('content/highcharts', 'content/exporting', '../jquery-ui/js/jquery-ui-1.10.0.custom.min', '../jquery-ui/js/jquery-ui-timepicker-addon'),
    'head'     => true, //加载头部文件
);
include getTpl('header', 'public');
?>
<!--顶部导航 开始-->
<?php include getTpl('top', 'public');?>
<!--顶部导航 结束-->
<!--左侧菜单 开始-->
<?php include getTpl('nav', 'public');?>
<!--左侧菜单 结束-->
<!--主体 开始-->
<!-- content -->
<section id="content">
    <!-- main padder -->
    <section class="main padder">
        <div class="clearfix">
            <h4><i class="fa fa-table"></i>订单分析</h4>
            <section class="panel">
                <header class="panel-heading bg-white">订单图表</header>
                <div class="panel-body">

					<div class="row text-small" style="text-align:center">
						<form action="<?php echo U('content/order/chart'); ?>" method="get">
                            <input type="hidden" name="g" value="content">
                            <input type="hidden" name="c" value="order">
                            <input type="hidden" name="m" value="chart">
							<div class="col-sm-2 m-b-mini">
								<label for="">开始时间 <input class="input-sm" name="starttime" id="starttime" size="16" type="text" value="<?php echo $starttime; ?>" readonly></label>
							</div>
							<div class="col-sm-2">
								<label for="">结束时间 <input class="input-sm" name="endtime" id="endtime" size="16" type="text" value="<?php echo $endtime; ?>" readonly></label>
							</div>
							
							<div class="col-sm-1" style="width:4%">
								<div class="input-group">
                                    <button class="btn btn-sm btn-white" type="submit">确定</button>
								</div>
							</div>

							<div class="col-sm-1">
								<div class="input-group">
									<a class="btn btn-sm btn-white" href="<?php echo U('order/chart'); ?>">重置</a>
								</div>
							</div>
						</form>
					</div>
					
					<div class="table-responsive">
						<div id="container" style="min-width:700px;height:700px"></div>
					</div>
                </div>
            </section>
        </div>
    </section>
    <!--/ main padder -->
</section>
<!--/ content -->
<!--主体 结束-->
<script>
$(function () {

    // $('#starttime').datetimepicker({"showTime":false,"showHour":false,"showMinute":false});
    // $('#endtime').datetimepicker({"showTime":false,"showHour":false,"showMinute":false});
    $('#starttime').datetimepicker();
    $('#endtime').datetimepicker();
    

    $('#container').highcharts({
        chart: {
            type: 'column',
            margin: [ 50, 50, 200, 80]
        },
        title: {
            text: '<?php echo $title; ?>'
        },
        xAxis: {
            categories: [<?php echo $goods_name; ?>],
            labels: {
                rotation: -45,
                align: 'right',
                style: {
                    fontSize: '13px',
                    fontFamily: 'simsun, sans-serif'
                }
            }
        },
        yAxis: {
            min: 0,
            title: {
                text: '商品数量'
            }
        },
        legend: {
            enabled: false
        },
        tooltip: {
            pointFormat: '销量: <b>{point.y:.0f} 件</b>',
        },
        series: [{
            name: '',
            data: [<?php echo $goods_sum; ?>],
            dataLabels: {
                enabled: true,
                rotation: -90,
                color: '#FFFFFF',
                align: 'right',
                x: 4,
                y: 10,
                style: {
                    fontSize: '13px',
                    fontFamily: 'simhei,simsun, sans-serif',
                    textShadow: '0 0 3px black'
                }
            }
        }]
    });
});
</script>
<?php include getTpl('footer', 'public'); ?>